package base.day21.MyHashSet2;

import base.day21.Student;

import java.util.HashSet;

public class MyHashSet2 {
    public static void main(String[] args) {
        Student stu1=new Student("zhangsan",23);
        Student stu2=new Student("lisi",24);
        Student stu3=new Student("zhangsan",23);
        HashSet<Student> hs=new HashSet<>();
        hs.add(stu1);
        hs.add(stu2);
        hs.add(stu3);


        System.out.println(stu1.hashCode());
        System.out.println(stu2.hashCode());
        System.out.println(stu3.hashCode());

        for (Student s : hs) {
            System.out.println(s);
        }
    }
}
